package com.maliu.utils
{
	import flash.display.DisplayObject;
	import flash.display.DisplayObjectContainer;
	
	/**
	 * 显示对象工具类
	 * @author maliu
	 */ 
	public class DisplayObjectUtil
	{
		public function DisplayObjectUtil()
		{
		}
		// 移除所有子显示对象
		public static function RemoveAllChildren(_container:DisplayObjectContainer):void
		{
			var t_n:int = _container.numChildren;
			var t_temp:DisplayObject;
			for(var i:int = 0; i<t_n; i++)
			{
				t_temp = _container.removeChildAt(0);
				if(t_temp is DisplayObjectContainer)
				{
					RemoveAllChildren(DisplayObjectContainer(t_temp));
				}
//				if(t_temp is Bitmap)
//				{
//					(t_temp as Bitmap).bitmapData.dispose();
//				}
				t_temp = null;
			}
		}
	}
}